<?php

class BaseController extends Controller
{
    /** @var AmaotoUser */
    protected $CurrentUser;

    public function __construct()
    {
        if (Auth::check()) {
            $this->CurrentUser = Auth::user();
            $this->CurrentUser->updateAct();
        } else {
            $this->CurrentUser = new AmaotoUser;
        }

        View::share('CurrentUser', $this->CurrentUser);
    }

    /**
     * Setup the layout used by the controller.
     *
     * @return void
     */
    protected function setupLayout()
    {
        if (!is_null($this->layout)) {
            $this->layout = View::make($this->layout);
        }
    }

}